package cn.tedu.spring.resource;

import cn.tedu.spring.config.SpringConfig;
import cn.tedu.spring.resource.controller.ReController;
import cn.tedu.spring.resource.service.ReService;
import org.junit.jupiter.api.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author ruoLi
 */
public class ResourceTest {
    @Test
    public void test() {
        ApplicationContext context = new ClassPathXmlApplicationContext("bean.xml");
        ReController reController = context.getBean(ReController.class);
        reController.runController();
    }

    @Test
    public void configTest() {
        //扫描配置类
        ApplicationContext context = new
                AnnotationConfigApplicationContext(SpringConfig.class);
        ReController reController= context.getBean(ReController.class);
        reController.runController();
    }
}
